home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / free_browsing / DavesQckSearchDbar3-14 / dqsd.exe / searches / conv.xml < prev    next >
Text File  |  2002-08-30  |  3KB  |  73 lines

  1. <search function="conv">
  2.   <name>Measurement Converter</name>
  3.   <description>
  4.     Convert units from one unit to another using ConvertIt.com. The second unit is optional.<br/>
  5.     <div class="helpboxDescLabels">Usage:</div>
  6.     <table class="helpboxDescTable">
  7.       <tr><td>conv <<i>unit1</i>> [/to <<i>unit2</i>>]</td></tr>
  8.       <tr><td>conv /from:<<i>unit1</i>> [/to:<<i>unit2</i>>]</td></tr>
  9.     </table>
  10.     <div class="helpboxDescLabels">Examples:</div>
  11.     <table class="helpboxDescTable">
  12.       <tr><td>conv 1/5 gallon</td></tr>
  13.       <tr><td>conv astronomical unit to football fields</td></tr>
  14.       <tr><td>conv /from:astronomical_unit /to:football_fields</td></tr>
  15.     </table>
  16.   </description>
  17.   <category>Functions</category>
  18.   <link>http://www.convertit.com/Go/Entisoft/Measurement/Converter.ASP</link>
  19.   <contributor>Monty Scroggins, Neel Doshi</contributor>
  20.  
  21.   <form name="convf"
  22.         action="http://www.convertit.com/Go/Entisoft/Measurement/Converter.ASP"
  23.         method="post">
  24.     <input type="hidden" name="From"/>
  25.     <input type="hidden" name="To" value=""/>
  26.   </form>
  27.  
  28.   <script><![CDATA[
  29.     function conv(q)
  30.     {
  31.       if ( nullArgs("conv", q) )
  32.         return false;
  33.       else
  34.       {
  35.         var switch_list = new Array("from", "to");
  36.         var switch_list_req = new Array("from");
  37.         var args = parseArgs(q, switch_list);
  38.  
  39.         var convf_from = "";
  40.         var convf_to = "";
  41.  
  42.         // check if the required switches are set
  43.         if ( typeof args.switch_val["from"] == "undefined" || args.switch_val["from"] == "" )
  44.         {
  45.           // Try using the original syntax if the from switch was not found
  46.           parsedunits = q.split(" to ");
  47.           convf_from = parsedunits[0];
  48.           if (typeof parsedunits[1] != 'undefined')
  49.             convf_to = parsedunits[1];
  50.         }
  51.         else
  52.         {
  53.           convf_from = args.q + " " + args.switch_val["from"].replace('_', ' ');
  54.           if ( typeof args.switch_val["to"] != "undefined" && args.switch_val["to"] != "" )
  55.           {
  56.             convf_to = args.switch_val["to"].replace('_', ' ');
  57.           }
  58.         }
  59.         document.convf.From.value = convf_from;
  60.         document.convf.To.value = convf_to;
  61.         submitForm(convf);
  62.         return(true);
  63.       }
  64.     }
  65.   ]]></script>
  66.  
  67.   <copyright>
  68.     Copyright (c) 2002 David Bau
  69.     Distributed under the terms of the
  70.     GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  71.   </copyright>
  72. </search>
  73.